package com.liner;

import java.math.BigDecimal;

/**
 * @author liner
 */
public class DataTypeDemo {

    public static void main(String[] args) {

        /*
         * char
         */
        char a3 = 'a';
        char A = 'A';
        char a0 = '0';
        System.out.println(a3);
        System.out.println(A);
        System.out.println(a0);

        System.out.println("____________________________");
        for (char i = 0; i <65535 ; i++) {
            System.out.print(i + "\t");
            if (i % 100 == 0){
                System.out.println();
            }
        }
        System.out.println("____________________________");
        char a4 = 65;   //A
        char a5 = 97;   //a
        char a6 = 48;   //0
        System.out.println(a4 + "\t" + a5 + "\t" + a6);

        char c1 = '\n';
        char c2 = '\t';
        char c3 = '\r';
        char c4 = '\\';
        char c5 = '\'';

        System.out.println(c1 + "\t" + c2 + "\t" + c3 + "\t" + c4 + "\t" + c5 );
        /*
         * boolean
         */
        boolean a2 = true;
        boolean b2 = false;


        /*
         * int
         */
        System.out.println(Integer.MAX_VALUE);

        System.out.println(2147483647 + 1); //溢出  运算时
        // System.out.println(2147483648); //编译错误 整数直接量，直接写



        /*
         * long
         */


        long a = 1000000000 * 2 * 10L;
        System.out.println(a);

        long b = 1000000000 * 3 * 10L;
        System.out.println(b);

        long c = 1000000000L * 3 * 10;
        System.out.println(c);

        System.out.println(2147483648L + 1);



        /*
         * double
         */

        double aa = 3.0, bb = 2.9;
        System.out.println(aa - bb);

        double cc = 4.0, dd = 0.1;
        System.out.println(cc - dd);

        double ee = 2.0, ff = 1.2;
        System.out.println(ee - ff);

        BigDecimal a1 = BigDecimal.valueOf(3.0);
        BigDecimal b1 = BigDecimal.valueOf(2.9);

        System.out.println(a1.subtract(b1).doubleValue());


    }

}
